package string;

import java.util.Arrays;

public class StringReplace {

    public static void main(String[] args) {
        String str="helloworld";
        //1、替换所有指定的内容
        String str1=str.replaceAll("l","-");
        System.out.println(str1);
        //2、替换首个字符内容
        String str2=str.replaceFirst("l","-");
        System.out.println(str2);
    }
}
